<?php

if (!$_SESSION["login"])
	header("Location: index.php?page=login");
	
else {
?>	

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<title>The Best Recipes</title>
	<link href="view/css/style.css" rel="stylesheet" type="text/css" media="screen" />
</head>

<body>
	<!-- wrapper -->
	<div id="wrapper">
	
		<!-- header and logo -->
		<?php
		
			require_once("templates/header.php");
		
		?>
		<!-- end header and logo -->
	
		<!-- page -->
		<div id="page">
			<!-- content -->
			<div id="admin">
				<!-- post -->
				<div class="post">
					<h2 class="title">Insert Recipe</h2>
					<div class="entry">
						<form method="post" action="index.php?page=checkrecipe" enctype="multipart/form-data">
							<p>title: <input type="text" side="20" name="title" /></p>
							<br/>
							<p>ingredients <span class="commas">(separated by commas)</span>: <input type="text" side="40" name="ingredients"/></p>
							<br/>
							<p>preparation: <textarea rows="10" cols="40" name="preparation"></textarea></p>
							<br/>
							<p>categories <span class="commas">(separated by commas)</span>: <input type="text" side="40" name="categories"/></p>
							<br/>
							<p>upload picture: <input type="file" name="file" /></p>
							<br/>"
							<input type="submit" value="insert" />
						</form>	
						<?php if ($state){ ?>
							<br />
							<div class="errormessage"> Incorrect fields </div>						
						<?php } ?>											
										
					</div>
				</div>
				<!-- end post -->
			</div>
			<!-- end content -->
		
			<div style="clear: both;">&nbsp;</div>
			
		</div>
		<!-- end page -->
	
		<!-- footer -->
		<?php
	
			require_once("templates/footer.php");
	
		?>
		<!-- end footer -->
	
	</div>
	<!-- end wrapper -->
</body>
</html>



	
<?php 	
}
?>